/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.kylingroup.J2SE.Thread;

/**
 *
 * @author kylin
 */
public class TestThreadPriority {
    public static void main(String args[]){
        Thread t1=new Thread(new MyThread5());
        Thread t2=new Thread(new MyThread6());
        t1.setPriority(Thread.NORM_PRIORITY+3);
        t1.start();
        t2.start();
    }
}

class MyThread5 implements Runnable{
    @Override
    public void run() {
        for(int i=0;i<500;i++){
            System.out.println("Th1: "+i);
        }
    }
}

class MyThread6 implements Runnable{
    @Override
    public void run() {
        for(int i=0;i<500;i++){
            System.out.println("--------Th2: "+i);
        }
    }
}